<?php
/*
 * Created on 2009/03/31
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */

require_once(HOME_PATH.'classes'.DIRECTORY_SEPARATOR.'affiliatewindow'.DIRECTORY_SEPARATOR.'class.shopcore.php');
require_once(HOME_PATH.'classes'.DIRECTORY_SEPARATOR.'class.smarty.php');


// init ShopCore
if ( !is_object($oShopCore) ) {
	$oShopCore = new shopcore();
}

// init Smarty
if ( !is_object($oSmarty) ) {
	$oSmarty = new Smarty_agent();
}


// load env vars into params obj
$oShopCore->syncApiParams($oCategoryTreeParams);


# get CategoryTree
$oCategoryTree = $oShopCore->oApiCategoryTree->getCategoryTree($oCategoryTreeParams);


# If vertical, enable display tree link
if (is_numeric(VERTICAL_CATEGORY_ID) && VERTICAL_CATEGORY_ID > 0) {
	$oSmarty->assign('sVerticalLink', 		$oShopCore->buildLink( P_CATEGORY, '', '', VERTICAL_CATEGORY_ID) );
}

# SMARTY ASSIGN
$oSmarty->assign('oCategories', 		$oCategoryTree);

?>
